<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="<?php echo X_UA_COMPATIBLE; ?>" />
<title><?php echo $this->page_title; ?></title>
<base href="<?php echo get_setting('base_url');?>/<?php echo G_INDEX_SCRIPT; ?>" />
<style type="text/css" media="all">
	@import url("<?php echo G_STATIC_URL; ?>/admin/css/default/admin_login.css?v=<?php echo G_VERSION_BUILD; ?>");
</style>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/jquery.js?v=<?php echo G_VERSION_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/plug_module/plug-in_module.js?v=<?php echo G_VERSION_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/functions.js?v=<?php echo G_VERSION_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/admin/js/global.js?v=<?php echo G_VERSION_BUILD; ?>"></script>
<script type="text/javascript">
	var G_INDEX_SCRIPT = '<?php echo G_INDEX_SCRIPT; ?>';
	var G_BASE_URL = '<?php echo get_setting('base_url'); ?><?php if (G_INDEX_SCRIPT) { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>';
</script>
</head>
<body>
<div class="default_setup">
  <p class="default_head"><span class="default_logo"></span></p>
  <div class="default_contents">
    <div class="default_error" id="notification"><h3 id="not_cont">请输入 E-mail / 账号、密码</h3></div>
    <form id="login_form" onsubmit="return false" action="admin/login/login_process_ajax/" method="post">
      <input type="hidden" value="3" name="step">
      <ul class="default_ul">
        <li>
          <label class="label">E-mail：</label>
		  <?php if($this->user_info){ ?>
        <span class="txt_color"><?php echo $this->user_info['email']; ?></span>
        <input class="default_textt" value="<?php echo $this->user_info['email']; ?>" type="hidden" name="username" id="username"/>
        <?php }else{ ?>
        <input class="default_text" type="text" name="username" id="username" />
        <?php } ?>
          </li>
        <li>
          <label class="label">密码：</label>
		    <input class="default_text" type="password" name="password" value="" id="password" onkeydown="if (event.keyCode == 13) { document.getElementById('login_submit').click(); };"/>
        </li>
        <?php if(get_setting('admin_login_seccode') == 'Y'){ ?>
        <li>
          <label class="label">验证码：</label>
		    <input class="default_text" style="width:60px;" type="text" name="seccode_verify" value="" id="seccode_verify" onkeydown="if (event.keyCode == 13) { document.getElementById('login_submit').click(); };"/> &nbsp; <img src="" onclick="this.src = G_BASE_URL + '/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?>/account/captcha/?' + Math.random();" id="seccode" style="vertical-align:middle" /> <a href="javascript:void(0);" onclick="$('#seccode').click();">换一张</a>
        </li>
        <?php } ?>
        <li  class="default_setup_n"><a id="login_submit" class="default_install" href="javascript:;" onclick="ajax_post($('#login_form'), _login_post_processer);">登 录</a></li>
      </ul>
    </form>
  </div>
</div>
<script type="text/javascript">
$(document).ready(function () {
	$('#seccode').click();
});

function _login_post_processer(result)
{
	if (result.errno == "-1")
	{
		$("#notification").removeClass("information").addClass("error");
		$("#not_cont").html(result.err);
	}
	else if(result.errno=="1")
	{
		if(result.rsm.url != undefined)
		{
			window.location.href = result.rsm.url;
		}
		else
		{
			window.location.href = G_BASE_URL + '/admin/';
		}
	}
}
</script>
<?php TPL::output('global/debuger.tpl.htm'); ?>
</body>
</html>